home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / MacFormat 92 CD / Shareware Plus / Utilities / FolderSynchronizer 1.8.9 / FoldersSynchronizer / FoldersSynchronizer.9 / AllScripts_7_Dialog.ls < prev    next >
Encoding:
Text File  |  2000-05-10  |  6.8 KB  |  201 lines

  1. on Dialog___________________________
  2. end
  3.  
  4. on InitWindows
  5.   global gCentroMonitorH, gCentroMonitorV, gDirDialog, gOpenedIndexWindow, gRectIndex, gAltezzaMin, gAltezzaMax, gRectReport, gMyReportWindow, gRectWindDate, gRectWindTimerHour
  6.   set the windowList to []
  7.   set gMyReportWindow to gDirDialog & "SR"
  8.   set wLunghezza to 480
  9.   set gAltezzaMax2 to 330
  10.   set L to gCentroMonitorH - (wLunghezza / 2)
  11.   set T to gCentroMonitorV - (gAltezzaMax2 / 2) - 60
  12.   set r to gCentroMonitorH + (wLunghezza / 2)
  13.   set b to gCentroMonitorV + (gAltezzaMax2 / 2) - 60
  14.   set gRectReport to rect(L, T, r, b)
  15.   set wLunghezza to 220
  16.   set wAltezza to 80
  17.   set L to gCentroMonitorH - (wLunghezza / 2)
  18.   set T to gCentroMonitorV - (wAltezza / 2) - 60
  19.   set r to gCentroMonitorH + (wLunghezza / 2)
  20.   set b to gCentroMonitorV + (wAltezza / 2) - 60
  21.   set gRectWindDate to rect(L, T, r, b)
  22.   set wLunghezza to 220
  23.   set wAltezza to 60
  24.   set L to gCentroMonitorH - (wLunghezza / 2)
  25.   set T to gCentroMonitorV - (wAltezza / 2) - 60
  26.   set r to gCentroMonitorH + (wLunghezza / 2)
  27.   set b to gCentroMonitorV + (wAltezza / 2) - 60
  28.   set gRectWindTimerHour to rect(L, T, r, b)
  29. end
  30.  
  31. on AlertBox message, ProssProc
  32.   global gSep, gDirDialog, gCentroMonitorH, gCentroMonitorV, gNextProcedura1
  33.   set mywindow to gDirDialog & "Dialog"
  34.   if not voidp(ProssProc) then
  35.     set gNextProcedura1 to ProssProc
  36.   else
  37.     set gNextProcedura1 to "nothing"
  38.   end if
  39.   set the modal of window mywindow to 1
  40.   set wLunghezza to 340
  41.   set wAltezza to 125
  42.   set L to gCentroMonitorH - (wLunghezza / 2)
  43.   set T to gCentroMonitorV - (wAltezza / 2) - 60
  44.   set r to gCentroMonitorH + (wLunghezza / 2)
  45.   set b to gCentroMonitorV + (wAltezza / 2) - 60
  46.   set the rect of window mywindow to rect(L, T, r, b)
  47.   set the windowType of window mywindow to 1
  48.   tell window mywindow
  49.     set the text of member "Messaggio" to message
  50.     set the text of member "P1" to "OK"
  51.     go("alert")
  52.   end tell
  53.   open(window mywindow)
  54.   moveToFront(window mywindow)
  55. end
  56.  
  57. on DialogBoxSiNo message, ProssimaProcedura1, ProssimaProcedura2, Primo, Secondo
  58.   global gNextProcedura1, gNextProcedura2, gSep, gDirDialog, gCentroMonitorH, gCentroMonitorV
  59.   updateStage()
  60.   set gNextProcedura1 to ProssimaProcedura1
  61.   set gNextProcedura2 to ProssimaProcedura2
  62.   set mywindow to gDirDialog & "Dialog"
  63.   set the modal of window mywindow to 1
  64.   set wLunghezza to 340
  65.   set wAltezza to 125
  66.   set L to gCentroMonitorH - (wLunghezza / 2)
  67.   set T to gCentroMonitorV - (wAltezza / 2) - 60
  68.   set r to gCentroMonitorH + (wLunghezza / 2)
  69.   set b to gCentroMonitorV + (wAltezza / 2) - 60
  70.   set the rect of window mywindow to rect(L, T, r, b)
  71.   set the windowType of window mywindow to 1
  72.   if (stringp(Primo) = 0) or (Primo = EMPTY) then
  73.     set Primo to "Yes"
  74.   end if
  75.   if (stringp(Secondo) = 0) or (Secondo = EMPTY) then
  76.     set Secondo to "No"
  77.   end if
  78.   tell window mywindow
  79.     set the text of member "Messaggio" to message
  80.     set the text of member "P1" to Primo
  81.     set the text of member "P2" to Secondo
  82.     go("SiNo")
  83.   end tell
  84.   open(window mywindow)
  85. end
  86.  
  87. on ShowReportWindow
  88.   global gMyReportWindow, gDirDialog, gMultiAll, gShortTextLog, gShortReportList, gCurrLog, gTotLog, gLogPathList, gShortFlag, gAltezzaWind, gRectReport, gBaseWind, gMaxLines
  89.   if not windowPresent(gMyReportWindow) then
  90.     set the rect of window gMyReportWindow to gRectReport
  91.     set the modal of window gMyReportWindow to 1
  92.     set the windowType of window gMyReportWindow to 8
  93.   end if
  94.   SetMenuWindows()
  95.   set gCurrLog to 1
  96.   set gTotLog to count(gShortReportList)
  97.   if gTotLog = 0 then
  98.     append(gShortReportList, gShortTextLog)
  99.   end if
  100.   set gTotLog to count(gShortReportList)
  101.   if count(gLogPathList) = 0 then
  102.     set gShortFlag to 1
  103.   end if
  104.   tell window gMyReportWindow
  105.     set gAltezzaWind to the bottom of gRectReport - the top of gRectReport
  106.     set gBaseWind to the right of gRectReport - the left of gRectReport
  107.     set the rect of member "fReport" to rect(0, 0, gBaseWind - 22, gAltezzaWind - 5 - 15)
  108.     set gMaxLines to the pageHeight of member "fReport" / the textHeight of member "fReport"
  109.     ReadLogText()
  110.     go("Report")
  111.   end tell
  112.   open(window gMyReportWindow)
  113. end
  114.  
  115. on ChiudiFreccia
  116.   set the member of sprite 18 to member "BtnUpFreccia0"
  117.   updateStage()
  118. end
  119.  
  120. on CloseReportWindow
  121.   global gMyReportWindow, gOpenedIndexWindow
  122.   close(window gMyReportWindow)
  123. end
  124.  
  125. on CloseAllWindow
  126.   global gMyReportWindow, gOpenedIndexWindow, gDirDialog
  127.   if windowPresent(gMyReportWindow) then
  128.     set gOpenedIndexWindow to 0
  129.     set the member of sprite 18 to member "BtnUpFreccia0"
  130.     updateStage()
  131.     close(window gMyReportWindow)
  132.   end if
  133.   if windowPresent(gDirDialog & "Dialog") then
  134.     close(window (gDirDialog & "Dialog"))
  135.   end if
  136. end
  137.  
  138. on OpenDateWind myLinea
  139.   global gNextProcedura1, gNextProcedura2, gSep, gDirDialog, gRectWindDate, gLastBackUpDate
  140.   SetMenuWindows()
  141.   set gNextProcedura1 to "ImportFilterDate " & myLinea
  142.   set gNextProcedura2 to "nothing"
  143.   set mywindow to gDirDialog & "Dialog"
  144.   set the modal of window mywindow to 1
  145.   set the rect of window mywindow to gRectWindDate
  146.   set the title of window mywindow to "Set Date"
  147.   set the windowType of window mywindow to 4
  148.   if line myLinea of field "fDateList" = " " then
  149.     set oggiGiorno to TodayDay(1)
  150.     set oggiMese to TodayMonth(1)
  151.     set oggiAnno to TodayYear(1)
  152.   else
  153.     set mialinea to line myLinea of field "fDateList"
  154.     set oggiGiorno to Sinistra(mialinea, 2)
  155.     set oggiMese to MeseNum(Centro(mialinea, 4, 6))
  156.     set oggiAnno to Destra(mialinea, 4)
  157.   end if
  158.   tell window mywindow
  159.     set the text of member "P1" to "Set"
  160.     put oggiAnno into field "fAnno"
  161.     put oggiMese into field "fMese"
  162.     put oggiGiorno into field "fGiorno"
  163.     set LastBackUpDateStr to "Set Last Backup Date:" && getAt(gLastBackUpDate, 3) && getAt(gLastBackUpDate, 2) && getAt(gLastBackUpDate, 1)
  164.     put LastBackUpDateStr into field "fLastBackupDate"
  165.     go("PrefDate")
  166.   end tell
  167.   open(window mywindow)
  168. end
  169.  
  170. on OpenHourWind myLinea
  171.   global gNextProcedura1, gNextProcedura2, gSep, gDirDialog, gRectWindTimerHour
  172.   SetMenuWindows()
  173.   set gNextProcedura1 to "ImportTimerHour " & myLinea
  174.   set gNextProcedura2 to "nothing"
  175.   set mywindow to gDirDialog & "Dialog"
  176.   set the modal of window mywindow to 1
  177.   set the rect of window mywindow to gRectWindTimerHour
  178.   set the title of window mywindow to "Set Hour"
  179.   set the windowType of window mywindow to 4
  180.   if line myLinea of field "fHourList" = " " then
  181.     set oggiHour to NowHour(1)
  182.     set oggiMinute to NowMinute(1)
  183.   else
  184.     set mialinea to line myLinea of field "fHourList"
  185.     set oggiHour to Sinistra(mialinea, 2)
  186.     set oggiMinute to Centro(mialinea, 4, 5)
  187.   end if
  188.   tell window mywindow
  189.     set the text of member "P1" to "Set"
  190.     put oggiHour into field "fHour"
  191.     put oggiMinute into field "fMinute"
  192.     go("TimerHour")
  193.   end tell
  194.   open(window mywindow)
  195. end
  196.  
  197. on chiudiWindow
  198.   close(the frontWindow)
  199.   updateStage()
  200. end
  201.